package com.example.ffepeg.controller;

import com.example.ffepeg.service.SpecAIgorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/specAI")
public class SpecAIgorController {
    @Autowired
    private SpecAIgorService specAIgorService;

    @PostMapping("getTask")
    public String getVideoId(){
        Map<String,Object> map = new HashMap<>();
        try {
            String taskId = specAIgorService.startTask();
            map.put("code",200);
            map.put("msg","ok");
            return taskId;
        }catch (Exception e){
            return e.getMessage();
        }
    }
}
